function fun() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      var a = 'hello';
      setTimeout(() => {
        var b = 'lagou'
        setTimeout(() => {
          var c = "I ❤ U";
          resolve(c)
          console.log(a + b + c)
        }, 10);
      }, 10);
      
    }, 10);
  })
}

fun().then(
  function onFulfilled(value) {
    console.log('onFulfilled', value);
  }, 
  function onRejected(error) {
    console.log('onRejected', error);
  }
)